/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package gui;

import bean.Aula;

import bean.Horarios;
import bean.Professor;

import controlador.ControladorPainelProfessor;
import java.io.IOException;

import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author Júnior
 */
public class PainelHorarioProfessor extends javax.swing.JPanel {

    /**
     * Creates new form PainelHorarioProfessor
     */
    List<Aula> listaAulas;
    List<Horarios> listaHorarios;
    List<Professor> listaProfessores;
    DefaultTableModel tabelaHorarioProfessor = new DefaultTableModel(new String[]{"Início", "Fim","Segunda","Terça","Quarta","Quinta","Sexta"},0){@Override 
    public boolean isCellEditable(int row, int column){ 
 return false; 
 }};
    
    public PainelHorarioProfessor() {
        initComponents();
        jTableHorario.getColumn("Início").setPreferredWidth(20);
        jTableHorario.getColumn("Fim").setPreferredWidth(20);
        listarProfessor();
        preencheTabela("M");
        jButtonGerarPdf.setEnabled(false);

    }
        
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jPanelBotoes = new javax.swing.JPanel();
        jButtonBuscar = new javax.swing.JButton();
        jButtonGerarPdf = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTableHorario = new javax.swing.JTable();
        jLabel2 = new javax.swing.JLabel();
        jComboBoxProfessor = new javax.swing.JComboBox();
        jLabel3 = new javax.swing.JLabel();
        jComboBoxTurno = new javax.swing.JComboBox();

        setMaximumSize(new java.awt.Dimension(830, 512));
        setMinimumSize(new java.awt.Dimension(830, 512));

        jLabel1.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N
        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel1.setText("Relatório por Professor");

        jPanelBotoes.setLayout(new java.awt.GridBagLayout());

        jButtonBuscar.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jButtonBuscar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/Find.png"))); // NOI18N
        jButtonBuscar.setText("Buscar");
        jButtonBuscar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonBuscarActionPerformed(evt);
            }
        });
        jPanelBotoes.add(jButtonBuscar, new java.awt.GridBagConstraints());

        jButtonGerarPdf.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jButtonGerarPdf.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/List.png"))); // NOI18N
        jButtonGerarPdf.setText("Gerar PDF");
        jButtonGerarPdf.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonGerarPdfActionPerformed(evt);
            }
        });
        jPanelBotoes.add(jButtonGerarPdf, new java.awt.GridBagConstraints());

        jTableHorario.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jTableHorario.setModel(tabelaHorarioProfessor);
        jTableHorario.getTableHeader().setReorderingAllowed(false);
        jScrollPane1.setViewportView(jTableHorario);

        jLabel2.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel2.setText("Professor :");

        jComboBoxProfessor.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jComboBoxProfessor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBoxProfessorActionPerformed(evt);
            }
        });

        jLabel3.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel3.setText("Turno :");

        jComboBoxTurno.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jComboBoxTurno.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Manhã", "Tarde", "Noite" }));
        jComboBoxTurno.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBoxTurnoActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jPanelBotoes, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 810, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jComboBoxProfessor, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jComboBoxTurno, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(jComboBoxProfessor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(jComboBoxTurno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 106, Short.MAX_VALUE)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 218, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanelBotoes, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void jButtonBuscarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonBuscarActionPerformed
        String turno;
        int opcao = jComboBoxProfessor.getSelectedIndex();
        int opcao3 = jComboBoxTurno.getSelectedIndex();
        if (opcao3 == 0) {
            turno = "Manhã";
        } else if (opcao3 == 1) {
            turno = "Tarde";
        } else {
            turno = "Noite";
        }
        
        if (listaProfessores.isEmpty()) {
            JOptionPane.showMessageDialog(null, "Não há Professores Cadastrados");
        } else  {
            
            Professor professor = listaProfessores.get(opcao);
            ControladorPainelProfessor cpp = new ControladorPainelProfessor();
            listaAulas = cpp.listaAula(professor.getMatricula(), turno.substring(0, 1));
            if (listaAulas.isEmpty()) {
                JOptionPane.showMessageDialog(null, "Não há Horário cadastrado para o Professor: " + jComboBoxProfessor.getSelectedItem() + " Turno: " + jComboBoxTurno.getSelectedItem());
            } else {
                montaTabela();
                jButtonGerarPdf.setEnabled(true);
            }
            
        }
        
    }//GEN-LAST:event_jButtonBuscarActionPerformed

    private void jComboBoxTurnoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBoxTurnoActionPerformed
        String turno;
        int opcao = jComboBoxTurno.getSelectedIndex();
        if (opcao == 0) {
            turno = "M";
        } else if (opcao == 1) {
            turno = "T";
        } else {
            turno = "N";
        }
        jButtonGerarPdf.setEnabled(false);
        preencheTabela(turno);
    }//GEN-LAST:event_jComboBoxTurnoActionPerformed

    private void jButtonGerarPdfActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonGerarPdfActionPerformed
        Pdf pdf = new Pdf();
        String turno;
        int opcao = jComboBoxProfessor.getSelectedIndex();
        
        int opcao3 = jComboBoxTurno.getSelectedIndex();
        if (opcao3 == 0) {
            turno = "Manhã";
        } else if (opcao3 == 1) {
            turno = "Tarde";
        } else {
            turno = "Noite";
        }
        
        try {
            pdf.relatorioProfessor(listaProfessores.get(opcao).getNome(), turno, tabelaHorarioProfessor);
            jButtonGerarPdf.setEnabled(false);
        } catch (IOException ex) {
            Logger.getLogger(PainelHorarioTurma.class.getName()).log(Level.SEVERE, null, ex);

        }
    }//GEN-LAST:event_jButtonGerarPdfActionPerformed

    private void jComboBoxProfessorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBoxProfessorActionPerformed
        String turno;
        int opcao = jComboBoxTurno.getSelectedIndex();
        if (opcao == 0) {
            turno = "M";
        } else if (opcao == 1) {
            turno = "T";
        } else {
            turno = "N";
        }
        jButtonGerarPdf.setEnabled(false); 
        preencheTabela(turno);
    }//GEN-LAST:event_jComboBoxProfessorActionPerformed

    private void listarProfessor(){
        ControladorPainelProfessor cpp = new ControladorPainelProfessor();
        listaProfessores = cpp.listaProfessor();
        int t = listaProfessores.size();
        for (int i = 0; i < t; i++) {
            Professor professor = listaProfessores.get(i);
            jComboBoxProfessor.addItem(professor.getNome());
        }
        
    }
    
    private void preencheTabela(String turno) {

        tabelaHorarioProfessor.setNumRows(0);
        ControladorPainelProfessor ch = new ControladorPainelProfessor();
        listaHorarios = ch.listaHorario(turno);
        int t = listaHorarios.size();
        for (int i = 0; i < t; i++) {
            Horarios horario = listaHorarios.get(i);
            tabelaHorarioProfessor.addRow(new Object[]{horario.getInicio(), horario.getFim(),"","","","",""});

        }
        
    }
    
    
     private void montaTabela() {
        int t = listaAulas.size();
        int y = 0;
        for (int i = 0; i < t; i++) {
            Horarios h = listaAulas.get(i).getHorario();
            int x = h.getCodHorario();
            for (int j = 0; j < listaHorarios.size(); j++) {
                if (listaHorarios.get(j).getCodHorario() != x) {
                } else {
                    y = j;
                    break;
                }
            }

            switch (listaAulas.get(i).getDia().getCodDia()) {
                case "Seg":
                    tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), y, 2);
                    break;
                case "Ter":
                    tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), y, 3);
                    break;
                case "Qua":
                    tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), y, 4);
                    break;
                case "Qui":
                    tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), y, 5);
                    break;
                default:
                    tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), y, 6);
                    break;
            }

        }
    }
     /*
    private void buscarManha() {
        int t = listaAulas.size();
        for (int i = 0; i < t; i++) {
            Horarios h = listaAulas.get(i).getHorario();
            int x = h.getCodHorario();

            switch (x) {
                case 1:
                    switch (listaAulas.get(i).getDia().getCodDia()) {
                        case "Seg":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 0, 2);
                            break;
                        case "Ter":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 0, 3);
                            break;
                        case "Qua":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 0, 4);
                            break;
                        case "Qui":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 0, 5);
                            break;
                        default:
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 0, 6);
                            break;
                    }
                    break;
                case 2:
                    switch (listaAulas.get(i).getDia().getCodDia()) {
                        case "Seg":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 1, 2);
                            break;
                        case "Ter":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 1, 3);
                            break;
                        case "Qua":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 1, 4);
                            break;
                        case "Qui":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 1, 5);
                            break;
                        default:
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 1, 6);
                            break;
                    }
                    break;
                case 3:
                    switch (listaAulas.get(i).getDia().getCodDia()) {
                        case "Seg":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 2, 2);
                            break;
                        case "Ter":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 2, 3);
                            break;
                        case "Qua":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 2, 4);
                            break;
                        case "Qui":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 2, 5);
                            break;
                        default:
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 2, 6);
                            break;
                    }
                    break;
                case 4:
                    switch (listaAulas.get(i).getDia().getCodDia()) {
                        case "Seg":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 3, 2);
                            break;
                        case "Ter":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 3, 3);
                            break;
                        case "Qua":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 3, 4);
                            break;
                        case "Qui":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 3, 5);
                            break;
                        default:
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 3, 6);
                            break;
                    }
                    break;
                case 5:
                    switch (listaAulas.get(i).getDia().getCodDia()) {
                        case "Seg":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 4, 2);
                            break;
                        case "Ter":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 4, 3);
                            break;
                        case "Qua":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 4, 4);
                            break;
                        case "Qui":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 4, 5);
                            break;
                        default:
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 4, 6);
                            break;
                    }
                    break;

            }

        }
    }

    private void buscarTarde() {
        int t = listaAulas.size();
        for (int i = 0; i < t; i++) {
            Horarios h = listaAulas.get(i).getHorario();
            int x = h.getCodHorario();

            switch (x) {
                case 6:
                    switch (listaAulas.get(i).getDia().getCodDia()) {
                        case "Seg":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 0, 2);
                            break;
                        case "Ter":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 0, 3);
                            break;
                        case "Qua":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 0, 4);
                            break;
                        case "Qui":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 0, 5);
                            break;
                        default:
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 0, 6);
                            break;
                    }
                    break;
                case 7:
                    switch (listaAulas.get(i).getDia().getCodDia()) {
                        case "Seg":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 1, 2);
                            break;
                        case "Ter":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 1, 3);
                            break;
                        case "Qua":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 1, 4);
                            break;
                        case "Qui":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 1, 5);
                            break;
                        default:
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 1, 6);
                            break;
                    }
                    break;
                case 8:
                    switch (listaAulas.get(i).getDia().getCodDia()) {
                        case "Seg":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 2, 2);
                            break;
                        case "Ter":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 2, 3);
                            break;
                        case "Qua":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 2, 4);
                            break;
                        case "Qui":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 2, 5);
                            break;
                        default:
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 2, 6);
                            break;
                    }
                    break;
                case 9:
                    switch (listaAulas.get(i).getDia().getCodDia()) {
                        case "Seg":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 3, 2);
                            break;
                        case "Ter":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 3, 3);
                            break;
                        case "Qua":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 3, 4);
                            break;
                        case "Qui":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 3, 5);
                            break;
                        default:
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 3, 6);
                            break;
                    }
                    break;
                case 10:
                    switch (listaAulas.get(i).getDia().getCodDia()) {
                        case "Seg":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 4, 2);
                            break;
                        case "Ter":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 4, 3);
                            break;
                        case "Qua":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 4, 4);
                            break;
                        case "Qui":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 4, 5);
                            break;
                        default:
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 4, 6);
                            break;
                    }
                    break;

            }

        }
    }

    private void buscarNoite() {
        int t = listaAulas.size();
        for (int i = 0; i < t; i++) {
            Horarios h = listaAulas.get(i).getHorario();
            int x = h.getCodHorario();

            switch (x) {
                case 11:
                    switch (listaAulas.get(i).getDia().getCodDia()) {
                        case "Seg":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 0, 2);
                            break;
                        case "Ter":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 0, 3);
                            break;
                        case "Qua":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 0, 4);
                            break;
                        case "Qui":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 0, 5);
                            break;
                        default:
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 0, 6);
                            break;
                    }
                    break;
                case 12:
                    switch (listaAulas.get(i).getDia().getCodDia()) {
                        case "Seg":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 1, 2);
                            break;
                        case "Ter":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 1, 3);
                            break;
                        case "Qua":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 1, 4);
                            break;
                        case "Qui":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 1, 5);
                            break;
                        default:
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 1, 6);
                            break;
                    }
                    break;
                case 13:
                    switch (listaAulas.get(i).getDia().getCodDia()) {
                        case "Seg":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 2, 2);
                            break;
                        case "Ter":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 2, 3);
                            break;
                        case "Qua":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 2, 4);
                            break;
                        case "Qui":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 2, 5);
                            break;
                        default:
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 2, 6);
                            break;
                    }
                    break;
                case 14:
                    switch (listaAulas.get(i).getDia().getCodDia()) {
                        case "Seg":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 3, 2);
                            break;
                        case "Ter":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 3, 3);
                            break;
                        case "Qua":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 3, 4);
                            break;
                        case "Qui":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 3, 5);
                            break;
                        default:
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 3, 6);
                            break;
                    }
                    break;
                case 15:
                    switch (listaAulas.get(i).getDia().getCodDia()) {
                        case "Seg":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 4, 2);
                            break;
                        case "Ter":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 4, 3);
                            break;
                        case "Qua":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 4, 4);
                            break;
                        case "Qui":
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 4, 5);
                            break;
                        default:
                            tabelaHorarioProfessor.setValueAt(listaAulas.get(i).getDisciplina().getNome(), 4, 6);
                            break;
                    }
                    break;

            }

        }
    }*/
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButtonBuscar;
    private javax.swing.JButton jButtonGerarPdf;
    private javax.swing.JComboBox jComboBoxProfessor;
    private javax.swing.JComboBox jComboBoxTurno;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JPanel jPanelBotoes;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTable jTableHorario;
    // End of variables declaration//GEN-END:variables
}
